﻿using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BTN04.DAO;
using BTN04.DTO;

namespace BTN04.BUS
{
    public class HoaDonBUS
    {
        //ham them hoa don
        public int ThemHoaDon(HoaDonDTO hdDTO)
        {
            HoaDonDAO hdDAO= new HoaDonDAO ();
            return hdDAO.ThemHoaDon(hdDTO);
        }

        //ham cap nhat ma tinh trang hoa don
        public int CapNhatTinhTrangHoaDon(int mahd, int matt)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.CapNhatTinhTrangHoaDon(mahd,matt);
        }
        //ham thong ke doanh so theo thang, nam
        public DataTable ThongKeDoanhSoTheoThang(int thang, int nam)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.ThongKeDoanhSoTheoThang(thang, nam);
        }
        //ham lay 10 san pham ban nhieu nhat
        public DataTable SanPhamTop10SoLuongBan()
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.SanPhamTop10SoLuongBan();
        }
        //ham lay 10 san pham ban nhieu nhat theo loai
        public DataTable SanPhamTop10SoLuongBanTheoLoai(int malsp)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.SanPhamTop10SoLuongBanTheoLoai(malsp );
        }
        //ham lay hoa don cua khach hang
        public DataTable SanPhamCuaKhachHangDaMua(int mand)
        {
            HoaDonDAO hdDAO = new HoaDonDAO();
            return hdDAO.SanPhamCuaKhachHangDaMua(mand);
        }
    }
}
